package com.xhcl.web.controller.system;

import java.util.List;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xhcl.common.annotation.Log;
import com.xhcl.common.core.controller.BaseController;
import com.xhcl.common.core.domain.AjaxResult;
import com.xhcl.common.enums.BusinessType;
import com.xhcl.framework.shiro.util.ShiroUtils;
import com.xhcl.system.domain.TSrhsKmye;
import com.xhcl.system.service.ITSrhsKmyeService;

/**
 * 
 * 期末结转
 * @author xhcl
 * @date 2020-09-02
 */
@Controller
@RequestMapping("/system/finalaccount")
public class TSrhsFinalAccountController extends BaseController
{
    private String prefix = "system/finalaccount";

    @Autowired
    private ITSrhsKmyeService tSrhsKmyeService;
   
    

    @RequiresPermissions("system:finalaccount:view")
    @GetMapping()
    public String finalaccount()
    {
        return prefix + "/finalaccount";
    }


    @RequiresPermissions("system:finalaccount:dofinal")
    @Log(title = "期末转账", businessType = BusinessType.UPDATE)
    @PostMapping("/doFinal")
    @ResponseBody
    public AjaxResult doFinal()
    {   
    	tSrhsKmyeService.doFinal();
        return AjaxResult.success();
    }
    
    
    @RequiresPermissions("system:finalaccount:undofinal")
    @Log(title = "期末转账", businessType = BusinessType.UPDATE)
    @PostMapping("/undoFinal")
    @ResponseBody
    public AjaxResult undoFinal()
    {   
    	tSrhsKmyeService.undoFinal();
        return AjaxResult.success();
    }

  

     
}
